// clang-format off
// SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
// clang-format on
// SPDX-FileContributor: Andrew Hayzen <andrew.hayzen@kdab.com>
//
// SPDX-License-Identifier: MIT OR Apache-2.0
#include <QtQml/QQmlEngine>
#include <QtQuickTest/quicktest.h>

#include "custom_object.h"
#include "external_qobject.h"

class Setup : public QObject
{
  Q_OBJECT

public:
  Setup()
  {

    qRegisterMetaType<CustomStruct>("CustomStruct");
    // Note the _cpp at the end of the URI. If qmlRegisterMetatype is used here
    // with the same URI as used by the QML elements generated from Rust, none
    // of the elements generated by Rust will be available to the QML engine.
    qmlRegisterType<CustomObject>(
      "com.kdab.cxx_qt.demo_cpp", 1, 0, "CustomObject");
    qmlRegisterType<ExternalQObject>(
      "com.kdab.cxx_qt.demo_cpp", 1, 0, "ExternalQObject");
  }
};

QUICK_TEST_MAIN_WITH_SETUP(main, Setup)

#include "main.moc"
